﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.dataaccess.model
{
    [XrmEntity("lead", "leadid")]
    public class LeadInfo:BaseModel
    {
        /// <summary>
        /// 数据来源
        /// 1:筛查客户名单同步，2:导诊工具，3:预约接口,4:批量预约,5:网医新增患者接口,6:商务通,7:呼叫中心,8:预约平台
        /// </summary>
        [XrmFieldMapping("new_datasource", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_datasource
        {
            get;
            set;
        } = 17;
        /// <summary>
        /// leadid
        /// </summary>
        [XrmFieldMapping("leadid", XrmAttributeType.UniqueIdentifier)]
        public Guid leadid
        {
            get ;
            set;
        }

        /// <summary>
        /// 标签ID
        /// </summary>
        //[Column(CrmType = CRMType.Relationship, LogicalName = "new_tag", RTFPKName = "leadid", RTName = "new_lead_new_tag", RTTPKName = "new_tagid")]
        //[DataMember]
       // [XrmFieldMapping("new_tagid", XrmAttributeType.EntityReference, true)]
       // [XrmReferenceType("new_lead_new_tag", default(string))]
        //public List<Guid> tag
        //{
        //    get ;
        //    set;
        //}

        /// <summary>
        /// 微信
        /// </summary>
        [XrmFieldMapping("new_wechat", XrmAttributeType.String, true)]
        public string new_wechat
        {
            get ;
            set;
        }

        /// <summary>
        /// QQ
        /// </summary>
        [XrmFieldMapping("new_qq", XrmAttributeType.String, true)]
        public string new_qq
        {
            get ;
            set;
        }

        /// <summary>
        /// 医保卡号
        /// </summary>
        [XrmFieldMapping("new_insuranceid", XrmAttributeType.String, true)]
        public string new_insuranceid
        {
            get ;
            set;
        }
        /// <summary>
        /// 年龄
        /// </summary>
        [XrmFieldMapping("new_age", XrmAttributeType.Int, true)]
        public int? new_age
        {
            get;
            set;
        }

        /// <summary>
        /// 姓
        /// </summary>
        [XrmFieldMapping("lastname", XrmAttributeType.String, true)]
        public string lastname
        {
            get;
            set;
        }

        /// <summary>
        /// 名
        /// </summary>
        [XrmFieldMapping("firstname", XrmAttributeType.String, true)]
        public string firstname
        {
            get;
            set;
        }

        ///// <summary>
        ///// 键入与潜在顾客关联的公司的名称。
        ///// 当潜在顾客获得资格并转换为客户帐户时，
        ///// 此名称将变为帐户名称
        ///// </summary>
        //[XrmFieldMapping("companyname", XrmAttributeType.String, true)]
        //public string companyname
        //{
        //    get;
        //    set;
        //}

        /// <summary>
        /// 联系方式
        /// </summary>
        [XrmFieldMapping("address1_telephone1", XrmAttributeType.String, true)]
        public string address1_telephone1
        {
            get ;
            set;
        }

        /// <summary>
        /// 0:未知的性别
        /// 1:男性
        /// 2:女性
        /// </summary>
        [XrmFieldMapping("new_gender", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_gender
        {
            get ;
            set;
        }

        /// <summary>
        /// 身份证号
        /// </summary>
        [XrmFieldMapping("new_citizenid", XrmAttributeType.String, true)]
        public string new_citizenid
        {
            get;
            set;
        }

        /// <summary>
        /// 1:省医保
        /// 2:城镇职工医保
        /// 3:城乡居民医保
        /// 4:新农合
        /// 5:其他
        /// </summary>
        [XrmFieldMapping("new_insurancetype", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_insurancetype
        {
            get;
            set;
        }

        /// <summary>
        /// 职业
        /// 1.学生
        /// 2.军人
        /// 3.政府及党政机关
        /// 4.行政文员
        /// 5.技术人员
        /// 6.其他
        /// </summary>
        [XrmFieldMapping("new_profession", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_profession
        {
            get ;
            set;
        }

        /// <summary>
        /// 首次来源方式
        /// 1:网络
        /// 2:电话咨询
        /// 3:筛查
        /// 4:网医
        /// 5:会员
        /// 6:大客户
        /// 7:校园
        /// 8:自然
        /// 9:其他
        /// </summary>
        [XrmFieldMapping("new_patientsource", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_patientsource
        {
            get ;
            set;
        }

        /// <summary>
        /// 常住详细地址
        /// </summary>
        [XrmFieldMapping("address1_name", XrmAttributeType.String, true)]
        public string address1_name
        {
            get ;
            set;
        }

        /// <summary>
        /// 眼部疾病　0:否，1:是
        /// </summary>
        [XrmFieldMapping("new_eyedisease", XrmAttributeType.Boolean, true)]
        public bool? new_eyedisease
        {
            get;
            set;
        }

        /// <summary>
        /// 眼部疾病史说明
        /// </summary>
        [XrmFieldMapping("new_eyedisease_instruction", XrmAttributeType.String, true)]
        public string new_eyedisease_instruction
        {
            get;
            set;
        }

        /// <summary>
        /// 心脏病史　0:否，1:是
        /// </summary>
        [XrmFieldMapping("new_heartdisease", XrmAttributeType.Boolean, true)]
        public bool? new_heartdisease
        {
            get ;
            set;
        }

        /// <summary>
        /// 心脏病史年份
        /// </summary>
        [XrmFieldMapping("new_heartdisease_times", XrmAttributeType.String, true)]
        public string new_heartdisease_times
        {
            get ;
            set;
        }

        /// <summary>
        /// 心脏病史说明
        /// </summary>
        [XrmFieldMapping("new_heartdisease_instruction", XrmAttributeType.String, true)]
        public string new_heartdisease_instruction
        {
            get ;
            set;
        }

        /// <summary>
        /// 糖尿病史　0:否，1:是
        /// </summary>
        [XrmFieldMapping("new_diabetes", XrmAttributeType.Boolean, true)]
        public bool? new_diabetes
        {
            get;
            set;
        }

        /// <summary>
        /// 糖尿病史年份
        /// </summary>
        [XrmFieldMapping("new_diabetes_times", XrmAttributeType.String, true)]
        public string new_diabetes_times
        {
            get ;
            set;
        }

        /// <summary>
        /// 糖尿病史说明
        /// </summary>
        [XrmFieldMapping("new_diabetes_instruction", XrmAttributeType.String, true)]
        public string new_diabetes_instruction
        {
            get ;
            set;
        }

        /// <summary>
        /// 高血压病史　0:否，1:是
        /// </summary>
        [XrmFieldMapping("new_hypertension", XrmAttributeType.Boolean, true)]
        public bool? new_hypertension
        {
            get ;
            set;
        }

        /// <summary>
        /// 高血压病史年份
        /// </summary>
        [XrmFieldMapping("new_hypertension_times", XrmAttributeType.String, true)]
        public string new_hypertension_times
        {
            get ;
            set;
        }

        /// <summary>
        /// 高血压病史说明
        /// </summary>
        [XrmFieldMapping("new_hypertension_instruction", XrmAttributeType.String, true)]
        public string new_hypertension_instruction
        {
            get;
            set;
        }
        /// <summary>
        /// 过敏史　0:否，1:是
        /// </summary>
        [XrmFieldMapping("new_allergy", XrmAttributeType.Boolean, true)]
        public bool? new_allergy
        {
            get ;
            set;
        }

        /// <summary>
        /// 过敏史说明
        /// </summary>
        [XrmFieldMapping("new_allergy_instruction", XrmAttributeType.String, true)]
        public string new_allergy_instruction
        {
            get;
            set;
        }

        /// <summary>
        /// 学校ID
        /// </summary>
        [XrmFieldMapping("new_school", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_school", default(string))]
        public Guid new_school
        {
            get ;
            set;
        }

        /// <summary>
        /// 班级ID
        /// </summary>
        [XrmFieldMapping("new_class", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_class", default(string))]
        public Guid new_class
        {
            get;
            set;
        }

        /// <summary>
        /// 学号
        /// </summary>
        [XrmFieldMapping("new_studentid", XrmAttributeType.String, true)]
        public string new_studentid
        {
            get ;
            set;
        }

        /// <summary>
        /// 家长手机号
        /// </summary>
        [XrmFieldMapping("address1_telephone3", XrmAttributeType.String, true)]
        public string address1_telephone3
        {
            get;
            set;
        }

        /// <summary>
        /// 电话2
        /// </summary>
        [XrmFieldMapping("address1_telephone2", XrmAttributeType.String, true)]
        public string address1_telephone2
        {
            get;
            set;
        }

        /// <summary>
        /// 家庭固定电话
        /// </summary>
        [XrmFieldMapping("telephone3", XrmAttributeType.String, true)]
        public string telephone3
        {
            get ;
            set;
        }

        /// <summary>
        /// 家长姓名
        /// </summary>
        [XrmFieldMapping("new_parentname", XrmAttributeType.String, true)]
        public string new_parentname
        {
            get ;
            set;
        }

        /// <summary>
        /// 0:先生 1:女士
        /// </summary>
        [XrmFieldMapping("new_alias", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_alias
        {
            get ;
            set;
        }

        /// <summary>
        /// 固定电话
        /// </summary>
        [XrmFieldMapping("telephone2", XrmAttributeType.String, true)]
        public string telephone2
        {
            get ;
            set;
        }
        /// <summary>
        /// 出生年份
        /// </summary>
        [XrmFieldMapping("new_birthyear", XrmAttributeType.String, true)]
        public string new_birthyear
        {
            get ;
            set;
        }
        /// <summary>
        /// 出生日期
        /// </summary>
        [XrmFieldMapping("new_birthdate", XrmAttributeType.DateTime, true)]
        public DateTime? new_birthdate
        {
            get ;
            set;
        }

        /// <summary>
        /// 手机号码2
        /// </summary>
        [XrmFieldMapping("new_mobile", XrmAttributeType.String, true)]
        public string new_mobile
        {
            get ;
            set;
        }
        
        /// <summary>
        /// 手机号
        /// </summary>
        [XrmFieldMapping("new_phone", XrmAttributeType.String, true)]
        public string new_phone
        {
            get;
            set;
        }

        /// <summary>
        ///是否会员 0:否，1:是
        /// </summary>
        [XrmFieldMapping("new_member", XrmAttributeType.Boolean, true)]
        public bool? new_member
        {
            get;
            set;
        }

        /// <summary>
        /// 说明
        /// </summary>
        [XrmFieldMapping("description", XrmAttributeType.String, true)]
        public string description
        {
            get ;
            set;
        }

        /// <summary>
        ///是否正式客户 0:否，1:是
        /// </summary>
        [XrmFieldMapping("new_isformal", XrmAttributeType.Boolean, true)]
        public bool? new_isformal
        {
            get ;
            set;
        }

        /// <summary>
        /// 说明
        /// </summary>
        [XrmFieldMapping("emailaddress1", XrmAttributeType.String, true)]
        public string emailaddress1
        {
            get ;
            set;
        }

        /// <summary>
        /// 状态
        /// statecode 0：已开启  statuscode 1:新建、2：已联系
        /// statecode 1：合格    statuscode 3:已审核
        /// statecode 2：不合格  statuscode 4:丢单、5：无法联系、6：不再感兴趣、7：已取消
        /// </summary>
        [XrmFieldMapping("statecode", XrmAttributeType.Int, true)]
        public int? statecode
        {
            get;
            set;
        }

        /// <summary>
        /// 医保地点 0：无 1：本地 2：异地
        /// </summary>
        [XrmFieldMapping("new_insurancelocation", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_insurancelocation
        {
            get;
            set;
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        [XrmFieldMapping("createdon", XrmAttributeType.DateTime, true)]
        public DateTime? createdon
        {
            get;
            set;
        }

        /// <summary>
        /// 创建人
        /// </summary>
        [XrmFieldMapping("createdby", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public Guid createdby
        {
            get ;
            set;
        }

        ///// <summary>
        ///// 修改时间
        ///// </summary>
        //[XrmFieldMapping("modifiedon", XrmAttributeType.DateTime, true)]
        //public DateTime? modifiedon
        //{
        //    get;
        //    set;
        //}

        ///// <summary>
        ///// 修改人
        ///// </summary>
        //[XrmFieldMapping("modifiedby", XrmAttributeType.EntityReference, true)]
        //[XrmReferenceType("systemuser", default(string))]
        //public Guid modifiedby
        //{
        //    get ;
        //    set;
        //}

        /// <summary>
        /// 负责人
        /// </summary>
        [XrmFieldMapping("ownerid", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public Guid ownerid
        {
            get;
            set;
        }

        /// <summary>
        /// 病种 1：白内障 2：儿童眼病 3: 高度近视 4:角膜及眼表 5:角膜塑形镜 6:泪道病 7:近视手术 8:斜弱视 9:眼底病
        ///      10:眼整形眼眶病 11:医学验光配镜 12:青光眼 13:其他 14:角膜移植 15:VIP特需门诊 
        /// </summary>
        [XrmFieldMapping("new_disease", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_disease
        {
            get;
            set;
        }

        [XrmFieldMapping("new_inputingtime", XrmAttributeType.DateTime, true)]
        public Nullable<DateTime> new_inputingtime { get; set; }

        [XrmFieldMapping("new_reservation", XrmAttributeType.Boolean, true)]
        public bool? new_reservation { get; set; }

        [XrmFieldMapping("new_coopdoctorid", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("contact", default(string))]
        public Guid? new_coopdoctorid
        {
            get;
            set;
        }

        [XrmFieldMapping("new_medicalinstitutionid", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("competitor", default(string))]
        public Guid? new_medicalinstitutionid
        {
            get;
            set;
        }

        //public List<Guid> tag;
    }
}
